/*
 * @Description:
 * @Author: zekit
 * @Date: 2022-02-17 13:47:13
 * @LastEditors: zehao.chen
 * @LastEditTime: 2022-08-20 12:37:48
 */
import http from '@/utils/request'


/**
 * @description: 用fileName换访问链接
 * @return {*}
 */
export const accessFile = (fileName) => {
  return http.get('/system/file/accessFile', { params: { fileName: fileName } })
}

/**
 * @description: 用fileName换访问链接
 * @return {*}
 */
export const getVideoImage = (fileName) => {
  return http.get('/system/file/getVideoImage', { params: { fileName: fileName } })
}

export const getNoticeCount = (data) => {
  return http.get('/pc/notice/count', { params: data })
}

/**
 * @description: 图片地址裁剪
 * @return {*}
 */
export const formatImageUrl = (fileUrl) => {
  if (fileUrl === '' || fileUrl === undefined || fileUrl === null)
    return ''
  let coverWebsite = fileUrl.split('?')[0]
  let saveCover = 'upload' + coverWebsite.split('upload')[1]
  return saveCover
}

